package com.meadvc.ssmdemo.util;

import java.util.Objects;

/**
 * @program: algorithm_test
 * @description:
 * @author: meadvc
 * @create: 2020-06-10 23:43
 **/
public class Comp {
    private String name;
    private double price;

    @Override
    public String toString() {
        return "Comp{" +
                "name='" + name + '\'' +
                ", price=" + price +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Comp comp = (Comp) o;
        //return Objects.equals(name,comp.name);
        return Double.compare(comp.price, price) == 0 &&
                Objects.equals(name, comp.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, price);
    }

    public Comp() {
    }

    public Comp(String name, double price) {
        this.name = name;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
